import axios from '@/libs/axios.js'
import axios_unxss from "@/libs/axios_unxss";
import baseUrl from './index'
let jsonHeaders = {'content-type': 'application/json;charset=UTF-8'}
let identity = 'identity'
//查询分布式设计师
export const queryDistributed = (data) => {
    return axios({
        url: `${baseUrl}/identity/company/distributed`,
        method: 'GET',
        data:JSON.stringify(data),
        headers: jsonHeaders,
    })
}
// 修改昵称列表
export const modifyNickname = (data) => {
    return axios({
        url: `${baseUrl}/identity/account/info`,
        method: 'put',
        data:JSON.stringify(data),
        headers: jsonHeaders,
    })
}
// 管理员修改密码
export const changePassword = (id,params) => {
    return axios({
      method: 'post',
      url: `${baseUrl}/${identity}/company/users/${id}/changePassword`,
      data: params,
      headers: jsonHeaders
    })
  }
// 修改邮箱
export const modifyEmail = (data) => {
    return axios({
        url: `${baseUrl}/identity/account/email`,
        method: 'put',
        data:JSON.stringify(data),
        headers: jsonHeaders,
    })
}
// 邮箱验证
export const sendCode = (email,data) => {
    return axios({
        url: `${baseUrl}/identity/anonymity/sendCode?email=${email}`,
        method: 'post',
        data:JSON.stringify(data),
        headers: jsonHeaders,
    })
}

export const register = (data) => {
    
    return axios({
        url: `${baseUrl}/identity/anonymity/register`,///anonymity/register
        method: 'post',
        data:JSON.stringify(data),
        headers: jsonHeaders,
    })
}
// 修改手机号
export const modifyPhone = (data) => {
    return axios({
        url: `${baseUrl}/identity/account/mobile`,
        method: 'put',
        data:JSON.stringify(data),
        headers: jsonHeaders,
    })
}
// 修改密码
export const modifyPwd = (data) => {
    return axios_unxss({
        url: `/identity/account/password`,
        method: 'put',
        data:JSON.stringify(data),
        headers: jsonHeaders,
    })
}
// 上传头像
export const modifyAva = (data) => {
    return axios({
        url: `${baseUrl}/identity/account/avatar`,
        method: 'put',
        data:JSON.stringify(data),
        headers: jsonHeaders,
    })
}

// 修改单位用户信息
export const modifyCompanyUserInfo = (id,data) => {
    return axios({
        url: `${baseUrl}/identity/company/users/${id}`,
        method: 'put',
        data:data,
        headers: jsonHeaders,
    })
}
export const queryRecordByUid = (params, data) => {
    return axios({
        url: `${baseUrl}/self-study/mycourse/studyRecord/list`,
        method: 'post',
        headers: jsonHeaders,
        params,
        data,
    })
  }
  export const studentAbilityStatistic = userId => {
    return axios({
        url: `${baseUrl}/drill-task/statistics/studentAbilityStatistic/${userId}`,
        method: 'get',
        headers: jsonHeaders
    })
  }
  export const studentAbilityStatisticNew = userId => {
    return axios({
        url: `${baseUrl}/drill-task/statistics/studentAbilityStatisticGsyh/${userId}`,
        method: 'get',
        headers: jsonHeaders
    })
  }
  //单独考试成绩走势 
  export const studentExamScoreStatistic = (userId,data) => {
    return axios({
        url: `${baseUrl}/drill-task/statistics/studentExamScoreStatistic/${userId}`,
        data:data,
        method: 'post',
        headers: jsonHeaders
    })
  }
  export const getDictInfoByName = params => {
    return axios({
        url: `${baseUrl}/dictionaries/sysConf/getInfoByName`,
        method: 'get',
        params: params,
        headers: jsonHeaders
    })
  }